import request from '@/request/request'

// 创建销售退货单
export function createSalesReturn(salesReturn) {
    return request({
        method: "post",
        url: '/sales/return',
        data: salesReturn
    })
}

// 分页获取销售退货单
export function getSalesReturnPage(pageParams) {
    return request({
        method: "post",
        url: '/sales/return/page',
        data: pageParams
    })
}

// 获取销售退货单详情（包含明细）
export function getSalesReturnWithDetails(id) {
    return request({
        method: "get",
        url: `/sales/return/withDetails/${id}`,
    })
}

// 更新销售退货单
export function updateSalesReturn(salesReturn) {
    return request({
        method: "put",
        url: '/sales/return',
        data: salesReturn
    })
}

// 删除销售退货单
export function deleteSalesReturn(id) {
    return request({
        method: "delete",
        url: `/sales/return/${id}`,
    })
}